from llama_index.core import VectorStoreIndex
from llama_index.core import Document
from llama_index.core import SimpleDirectoryReader
from llama_index.core.extractors import TitleExtractor, KeywordExtractor
from llama_index.core.node_parser import TokenTextSplitter
from llama_index.embeddings.openai import OpenAIEmbedding
from pprint import pprint
from llama_index.core.schema import TextNode

node1 = TextNode(text="这是一个文本块1", id_="node1", metadata={"source": "手工创建"})
node2 = TextNode(text="这是一个文本块1", id_="node2")
node3 = TextNode(text="这是一个文本块1", id_="node3")

index = VectorStoreIndex([node1, node2, node3])

query_engine = index.as_query_engine()
response = query_engine.query("这些节点包含什么信息?")
print(response)
